package com.xc.h05.service.wyl.impl;

import com.xc.h05.entity.Mynotice;
import com.xc.h05.mapper.MynoticeMapper;
import com.xc.h05.service.wyl.MyNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyNoticeServiceImpl implements MyNoticeService {
    @Autowired
    private MynoticeMapper mynoticeMapper;
    public List<Mynotice> findAll() {
        return mynoticeMapper.findAll();
    }

    @Override
    public List<Mynotice> find() {
        List<Mynotice> mynotices = mynoticeMapper.find();
        return mynotices;
    }

    @Override
    public int add(Mynotice mynotice) {
        return mynoticeMapper.insert(mynotice);
    }

    @Override
    public int delete(Long id) {
        return mynoticeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(Mynotice mynotice) {
        return mynoticeMapper.updateByPrimaryKey(mynotice);
    }

    @Override
    public Mynotice findById(Long id) {
        return mynoticeMapper.selectByPrimaryKey(id);
    }
}
